#pragma once

#include "SQLConnect.h"
#include "SQLQuery.h"
#include "KtvTracker.h"

#define   FETCH_STATUS_SLEEP   0
#define   FETCH_STATUS_CONN    1
#define   FETCH_STATUS_SEND    2
#define   FETCH_STATUS_RECV    3
#define   FETCH_STATUS_PARSE   4


class CFetchRoomStatus
{
public:
	CFetchRoomStatus(  );
	~CFetchRoomStatus(void);
	int Update(void);

protected:

	ULONGLONG m_qwLastUpdate;

	CSQLConnect  conn;

	CSQLQuery  query;

	PER_IO_OPERATION_DATA ioSetData;

	

	QWORD qwNextFetchRoomData;

	RoomData*  m_lpRoomData;
	UINT       m_nRoomCount;

	TCHAR szMsgBuffer[512];

	int m_nStatus;

	QWORD m_qwLastSetRoomName;


public:
	int FetchData(void);
	int ParseResult(void);
};
